import request from './request'

/**
 * 获取日志采集源列表
 */
export function getLogSourceList() {
  return request({
    url: '/log-source/list',
    method: 'get'
  })
}

/**
 * 创建日志采集源
 */
export function createLogSource(data) {
  return request({
    url: '/log-source/create',
    method: 'post',
    data
  })
}

/**
 * 更新日志采集源
 */
export function updateLogSource(data) {
  return request({
    url: '/log-source/update',
    method: 'put',
    data
  })
}

/**
 * 删除日志采集源
 */
export function deleteLogSource(id) {
  return request({
    url: `/log-source/delete/${id}`,
    method: 'delete'
  })
}

/**
 * 获取采集源详情
 */
export function getLogSourceDetail(id) {
  return request({
    url: `/log-source/${id}`,
    method: 'get'
  })
}

/**
 * 获取采集源监控数据
 */
export function getSourceMonitor(sourceId) {
  return request({
    url: `/monitor/source/${sourceId}`,
    method: 'get'
  })
}

